package com.aote.rs.BeforeAction;

import java.util.Map;

import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.QueryParam;

import com.aote.util.SingleValueHelper;

@Path("/")
public class UpdateSingleValue implements IBeforeAction {

	/**
	 * 更新单值
	 */

	public void doAction(Map attribures, String field, String name) {
		String value = attribures.get(field).toString();
		if (value != null && !value.equals("")) {
			SingleValueHelper.UpdataNameOfValue(name, value);
		}
	}

	@Path("/updatesingle")
	@POST
	public void action(@QueryParam("name")
	String name, @QueryParam("field")
	String value) {
		if (value != null && !value.equals("")) {
			SingleValueHelper.UpdataNameOfValue(name, value);
		}
	}
}
